/** * 合同详情 */
<template>
  <view class="container">
    <!-- <u-search shape="round"></u-search> -->
    <u-form :model="form" ref="uForm" label-width="200">
      <u-form-item label="项目组名称"
        ><u-input v-model="form.projectName" disabled
      /></u-form-item>
      <u-form-item label="项目编号"
        ><u-input v-model="form.projectCode" disabled
      /></u-form-item>
      <u-form-item label="实施合同"
        ><u-input v-model="form.implementContractId_dictText" disabled
      /></u-form-item>
      <u-form-item label="负责部门"
        ><u-input v-model="form.departmentId_dictText" disabled
      /></u-form-item>
      <u-form-item label="分管领导"
        ><u-input v-model="form.leaderId_dictText" disabled
      /></u-form-item>
      <u-form-item label="项目负责人"
        ><u-input v-model="form.projectMainId_dictText" disabled
      /></u-form-item>
      <u-form-item label="项目副负责人"
        ><u-input v-model="form.projectSecondaryId_dictText" disabled
      /></u-form-item>
      <u-form-item label="项目总工"
        ><u-input v-model="form.projectChief_dictText" disabled
      /></u-form-item>
      <u-form-item label="项目主管总工"
        ><u-input v-model="form.projectCharge_dictText" disabled
      /></u-form-item>
      <!-- 			<u-form-item label="当前步骤"><u-input v-model="form.stepId" disabled/></u-form-item> -->
      <u-form-item label="创建时间"
        ><u-input v-model="form.createTime" disabled
      /></u-form-item>
      <u-form-item label="最后更新时间"
        ><u-input v-model="form.updateTime" disabled
      /></u-form-item>
      <u-form-item label="项目总工">
        <u-input v-model="form.projectChief" disabled />
      </u-form-item>
      <u-form-item label="实施状态">
        <text
          disabled
          :class="[
            form.implementationStatus_dictText !== '实施完成' ? 'noDone' : 'done',
          ]"
        >{{form.implementationStatus_dictText}}</text>
      </u-form-item>
      <u-form-item label="备注">
        <u-input v-model="form.remark" disabled />
      </u-form-item>
    </u-form>
  </view>
</template>

<script>
import xiangmuApi from "../../api/xiangmu.js";
export default {
  // 必须要在onReady生命周期，因为onLoad生命周期组件可能尚未创建完毕
  onReady() {
    this.$refs.uForm.setRules(this.rules);
  },
  mounted() {
    console.log("this.$Route.query", this.$Route.query);
    // this.disabled = this.$Route.query.current ? true : false
    console.log("this.disabled", this.disabled);
    const {
      implementationStatus_dictText,
      projectCode,
      projectName,
      implementContractId_dictText,
      projectCharge,
      stepId,
      createTime,
      updateTime,
      projectChief,
      remark,
      departmentId_dictText,
      projectMainId_dictText,
      leaderId_dictText,
      projectCharge_dictText,
      projectSecondaryId_dictText,
      projectChief_dictText,
    } = this.$Route.query.obj;
    this.form.implementationStatus_dictText =
      implementationStatus_dictText || "无";
    this.form.projectCode = projectCode || "无";
    this.form.projectName = projectName || "无";
    this.form.implementContractId_dictText =
      implementContractId_dictText || "无";
    this.form.projectCharge = projectCharge || "无";
    this.form.stepId = stepId || "无";
    this.form.createTime = createTime || "无";
    this.form.updateTime = updateTime || "无";
    this.form.projectChief = projectChief || "无";
    this.form.remark = remark || "无";
    this.form.departmentId_dictText = departmentId_dictText || "无";
    this.form.projectMainId_dictText = projectMainId_dictText || "无";
    this.form.leaderId_dictText = leaderId_dictText || "无";
    this.form.projectCharge_dictText = projectCharge_dictText || "无";
    this.form.projectSecondaryId_dictText = projectSecondaryId_dictText || "无";
    this.form.projectChief_dictText = projectChief_dictText || "无";
    xiangmuApi
      .getXiangMuDetail(
        {
          "X-Access-Token": this.$store.state.token,
        },
        {
          id: this.$Route.query.obj.id,
          // tableName: this.$Route.query.obj.tableName,
        }
      )
      .then((res) => {
        console.log("111", res);
      })
      .catch((err) => {
        console.log(err);
      });
  },
  data() {
    return {
      form: {
        projectCode: "",
        implementationStatus_dictText: "",
        projectName: "",
        projectCharge: "",
        stepId: "",
        createTime: "",
        updateTime: "",
        projectChief: "",
        remark: "",
        implementContractId_dictText: "",
        departmentId_dictText: "",
        projectMainId_dictText: "",
        leaderId_dictText: "",
        projectCharge_dictText: "",
        projectSecondaryId_dictText: "",
        projectChief_dictText: "",
      },
      // 判断是否可写
      disabled: false,
      // 请假离开时间是否显示
      leaveShow: false,
      // 请假截止时间是否显示
      deadlineShow: false,
      // 日历模式
      mode: "date",
      // 弹出框的显示
      popupShow: false,
      // 弹出框内表单数据
      passForm: {
        // 审批意见
        suggestion: "",
      },
    };
  },
  methods: {},
};
</script>

<style scoped lang="scss">
.container {
  width: 90%;
  margin: 0 auto;
  .btns {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
  }
}

.done{
  color: #800080 !important;
  font-weight: bold;
}
.noDone {
  color: black !important;
  font-weight: bold;
}
</style>
